/*
 * @Author: wanli wanliofficial@aliyun.com
 * @Date: 2025-06-08 12:33:43
 * @LastEditors: wanli wanliofficial@aliyun.com
 * @LastEditTime: 2025-06-15 16:56:47
 * @FilePath: \reactor-programming\graalvm-webflux-r2dbc\src\main\java\com\wanli\graalvmdemo\DemoApplication.java
 * @Description: 
 * 
 * Copyright (c) 2025 by wanli email: wanliofficial@aliyun.com, All Rights Reserved. 
 */
package com.wanli.graalvmdemo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.EnumerablePropertySource;
import org.springframework.core.env.MutablePropertySources;
import org.springframework.core.env.PropertySource;

import java.util.Iterator;

@SpringBootApplication
public class DemoApplication {
    private static final Logger logger = LoggerFactory.getLogger(DemoApplication.class);

    public static void main(String[] args) {
        /*
         * System.setProperty("file.encoding", "UTF-8");git
         * System.setProperty("sun.net.spi.nameserver.nameservers", "8.8.8.8,8.8.4.4");
         * System.setProperty("sun.net.spi.nameserver.provider.1", "dns,sun");
         */
        ConfigurableApplicationContext context = SpringApplication.run(DemoApplication.class, args);
        // ConfigurableEnvironment environment = context.getEnvironment();
        // MutablePropertySources propertySources = environment.getPropertySources();
        // Iterator<PropertySource<?>> iterator = propertySources.stream().iterator();
        // while (iterator.hasNext()) {
        // PropertySource<?> next = iterator.next();
        // if (next instanceof EnumerablePropertySource enumerablePropertySource) {
        // String[] propertyNames = enumerablePropertySource.getPropertyNames();
        // for (String propertyName : propertyNames) {
        // logger.info("property_name=[" + propertyName + "], property_value=[" +
        // environment.getProperty(propertyName) + "]");
        // }
        // }
        // }
    }
}
